<template>
  <view
    class="content"
    :style="{
      'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        height: statusBarHeight + 'px',
      }"
    >
    </view>
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">注销账号</view>
      <view class="head_right"> </view>
    </view>

    <view class="box" v-html="content">
      <!-- <view class="box_img">
        <image src="@/static/images/my/icon_zxzh_tishi.png"></image>
      </view>
      <view class="box_title"
        >注销账号是不可恢复的操作，注销后你的账号中的个人资料、服务工单、访客记录等内容都将无法被找回。操作前请确认以上信息均已妥善处理。</view
      >
      <view class="box_view">
        <view class="box_view_title"
          >注销账号前，我们需要进行以下验证，以保证你的账号、财产安全。</view
        >
        <view class="box_view_item">
          <view class="box_view_item_title">1、账号处于安全状态</view>
          <view class="box_view_item_text"
            >最近两周内，你没有进行修改密码、修改绑定手机号等敏感操作且账号无被限制记录</view
          >
        </view>
        <view class="box_view_item">
          <view class="box_view_item_title"
            >2、账号财产已结清，没有未完成和/或存在争议的服务</view
          >
          <view class="box_view_item_text"
            >账号中没有未完成的服务工单;没有处理中或待匹配的服务等服务。</view
          >
        </view>
        <view class="box_view_item">
          <view class="box_view_item_title">3、账号无任何未处理完成的纠纷</view>
        </view>
      </view> -->
    </view>

    <view class="bottom">
      <view class="bottom_btn" @click="logOff">确认注销</view>
    </view>


    <floatingBall></floatingBall>
  </view>
</template>
  
  <script>
import selectType from "@/components/selectType.vue";
export default {
  components: {
    selectType,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      content:''
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度

    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height;
        })
        .exec();
    });
    this.getContent()
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    logOff() {
      this.$http
        .userZhuxiao({})
        .then((res) => {
          console.log(res.message, "注销");
          uni.$u.toast(res.message);

          setTimeout(() => {
            uni.reLaunch({
              url: "/pages/login/index",
            });
          }, 2000);
        })
        .catch((error) => {
          console.log(error, "错误");
          uni.$u.toast(error);
        });
    },
    getContent() {
      this.$http
        .appversionAgreement({})
        .then((res) => {
          console.log(res.data.user_agreement, "注销账号");
          this.content = res.data.cancel_account.content;
        })
        .catch((error) => {
          console.log(error, "错误");
          uni.$u.toast(error);
        });
    },
  },
};
</script>
  
  <style scoped lang="scss">
.content {
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;
  background: #fff;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .head_right {
    position: absolute;
    right: 30rpx;
    display: flex;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444444;
  }
}
.box {
  padding: 32rpx 30rpx;
  box-sizing: border-box;
  font-size: 30rpx;
  line-height: 56rpx;
  .box_img {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    image {
      width: 160rpx;
      height: 160rpx;
    }
  }
  .box_title {
    font-size: 30rpx;
    color: #888888;
    line-height: 54rpx;
    margin-top: 56rpx;
  }
  .box_view {
    padding: 0 30rpx;
    margin-top: 32rpx;
    .box_view_title {
      font-size: 30rpx;
      color: #888888;
      line-height: 54rpx;
    }
    .box_view_item {
      margin-top: 48rpx;
      .box_view_item_title {
        color: #444444;
        font-size: 30rpx;
        line-height: 54rpx;
      }
      .box_view_item_text {
        color: #888888;
        font-size: 30rpx;
        line-height: 54rpx;
      }
    }
  }
}

.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  .bottom_btn {
    width: 630rpx;
    height: 96rpx;
    background: #ee6060;
    border-radius: 48rpx;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30rpx;
    margin-bottom: 88rpx;
  }
}
</style>